<%@ Reference Page="~/default.aspx" %> <%@ Register TagPrefix="searchengine" Namespace="Keyoti.SearchEngine.Web" Assembly="Keyoti2.SearchEngine.Web" %> <%@ Page language="c#" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" > <html> <head> </head> <body> <form id="Form1" method="post" runat="server"> <searchengine:searchbox id="SearchBox1" runat="server" ResultPageURL="SearchResults.aspx" AutoCompleteQuery="true" AutoCompleteQueryShowNumberOfResults="false" AutoCompleteIndexDirectory="~/IndexDirectory"> </searchengine:searchbox> </form> </body> </html>
AutoCompleteQuery is set to true, allowing available search terms to be shown as the user types in the SearchBox, The AutoCompleteIndexDirectory property is set to the path (relative URL or absolute file path) of the index directory.
Example on customizing the suggestions
The 'preview' icon/expander part of the template is highlighted in blue.
<%@ Register TagPrefix="searchengine" Namespace="Keyoti.SearchEngine.Web" Assembly="Keyoti2.SearchEngine.Web" %>
<%@ Page language="c#" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<html>
<head>
</head>
<body>
<form id="Form1" method="post" runat="server">
<searchengine:searchresult id="SearchResult1" runat="server"
Width="913px" HighlightQueryWordsInSummary="True" IndexDirectory="~/IndexDirectory"
ResultPreviewerEnabled="True">
<ResultItemTemplate>
<div class='SEResultItem'>
<table border="0">
<tr>
<td class='SEResultItemLink' style='font-family: sans-serif, Verdana, Arial, Helvetica;
font-size: 10pt;'>
<a href="<%# Container.Uri %>">
<%# Container.Title %>
</a>
</td>
</tr>
<tr>
<td class='SEResultItemSummary' style='font-family: sans-serif, Verdana, Arial, Helvetica;
font-size: 9pt;'>
<%# Container.Summary%>
<span class='sew_previewResultWrapper'>...<img alt="Click to preview the document text"
onclick="sew_toggleResultPreview(this, '<%# Container.UriAsStored %>',
'<%# Container.ResultPreview_Expander_ClosedUrl %>', '<%# Container.ResultPreview_Expander_OpenedUrl %>')"
src="<%# Container.ResultPreview_Expander_ClosedUrl %>" /><span class='sew_previewResultContent'>Loading
document...</span></span></td>
</tr>
<tr>
<td class='SEResultItemURL' style='font-family: sans-serif, Verdana, Arial, Helvetica;
font-size: 8pt; color: green;'>
<%# Container.Uri %>
</td>
</tr>
<tr>
<td class='SELocation' style='font-family: sans-serif, Verdana, Arial, Helvetica;
font-size: 8pt; color: gray;'>
<%# Container.Location %>
</td>
</tr>
<tr>
<td class='SEContent' style='font-family: sans-serif, Verdana, Arial, Helvetica;
font-size: 8pt; color: gray;'>
<%# Container.Content %>
</td>
</tr>
</table>
</div>
<br>
</ResultItemTemplate>
</searchengine:searchresult>
</form>
</body>
</html>
ResultPreviewerEnabled is set to true, allowing the user to see preview of a search result without having to leave the results page.